<?php
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', 'IndexController@index');
Route::get('/login', 'IndexController@login')->name('login');
Route::get('/login_out', 'IndexController@login_out');
Route::get('/register', 'IndexController@register');
Route::post('/ajax_login', 'IndexController@ajax_login');
Route::post('/ajax_register', 'IndexController@ajax_register');
Route::middleware(['loginsession'])->group(function(){
    Route::get('/', 'IndexController@index');
    Route::get('/chat_list', 'IndexController@chat_list');
    Route::get('/chat/{id}', 'ChatController@chat');
    Route::post('/join_chat', 'ChatController@index');
});